home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 008 / mandzoom.arc / MANDEL.DOC < prev    next >
Encoding:
Text File  |  1985-11-19  |  14.4 KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                      INTRODUCTION TO
  8.                                  THE MANDELBROT EXPLORER
  9.                                                
  10.                  
  11.                  The programs MANDELEX.EXE (or MANDELLO.EXE),
  12.             PICPAC.EXE, UNPACPIC.EXE, PLOTPAC.EXE, and PLOT.EXE are all
  13.             meant to work together to produce regions of the Mandelbrot
  14.             set on your screen.
  15.                  All of the programs require DOS 2.0 or later.  The
  16.             creation programs (MANDELEX.EXE and MANDELLO.EXE) require an
  17.             8087 mathematics co-processor (they will crash computers
  18.             which do not have an 8087 installed).  MANDSLEX and MANDSLO
  19.             are the same programs, but with floating point routines so
  20.             they can work without the 8087.  Even with the 8087,
  21.             generating a picture can take up to 12 hours (although in
  22.             most cases, the program requires quite a bit less time--
  23.             especially if you use MANDELLO.EXE).  MANDELEX.EXE requires
  24.             an IBM enhanced color graphics adapter (or BIOS equivalent--
  25.             it will also work with either the monochrome monitor or
  26.             enhanced color display), and MANDELLO.EXE should work with
  27.             any IBM compatible color card.  I do not know whether it
  28.             will work on any of the monochrome graphics cards.  If it
  29.             does not, and you would like for me to try and make it work
  30.             on yours, send me (Bradley Dyck Kliewer; DK Micro
  31.             Consultants; 3001 E. 24th St.; Minneapolis, MN  55406) the
  32.             technical information about graphics on your system, and I
  33.             will see if I can modify the program.
  34.                  The program can zoom in on areas of the Mandelbrot set.
  35.             You must specify the coordinates of the lower left hand
  36.             corner, and the length of the side.  The vertical axis is
  37.             the imaginary part and the horizontal axis is the real part.
  38.             The default settings draw the entire set (from -2.00 to 0.50
  39.             and -1.25i to 1.25i, obtained by typing -2.00 for the real
  40.             part, -1.25 for the imaginary part, and 2.50 for the length
  41.             of the side [or by hitting the enter key at each prompt]).
  42.             If the program cannot use the value you give it, i.e. if it
  43.             is not a number or in an improper format, it will give the
  44.             prompt again.  Note that integers must be followed by a
  45.             decimal point e.g. "0" must be entered as "0." and "1" as
  46.             "1.".  Numbers may be entered in floating point notation.
  47.                  One area that is very interesting is -.73388, .1964567i
  48.             (don't type the "i"), .0000012.  Also, in this same area at
  49.             different scales, try -.73395, .19645i, .0005 and -.73388,
  50.             .1964567i, .0000061.  This might give you a feel for the
  51.             zooming effect.
  52.                  This program was inspired by an article in the August
  53.             1985 issue of "Scientific American."  If you are interested
  54.             in how the program works, pictures generated by a similar
  55.             program, and suggestions of other places to look, read the
  56.             article by A. K. Dewdney on page 16.  Another book which
  57.             might be of interest is "The Fractal Geometry of Nature" by
  58.             Benoit B. Mandelbrot.  I am hoping to write programs for
  59.             other fractals (especially the dragon curves).  If you
  60.             register your program with me (by sending $10 with your name
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.             and address) I will inform you of updates to the program.
  74.             Also feel free to send comments about improvements, or other
  75.             fractals you would like to see supported (along with the
  76.             equation if you know it).
  77.                  
  78.                                   RUNNING THE PROGRAMS
  79.                  
  80.                  Put the program disk in drive A: and type MANDELEX (or
  81.             MANDELLO if you have a normal graphics adapter) at the DOS
  82.             A> prompt.  Enter the data (as described in the previous
  83.             section) at the prompts.  To save the screen before the
  84.             program is finished, type "S" and a filename prompt will
  85.             appear.  To exit the program prematurely, type "E"--you will
  86.             then need to confirm, "Y" to exit or "N" to continue and
  87.             then confirm a save--"Y" to save, "N" to exit without
  88.             saving.  Filenames can be any legal path and name, however,
  89.             I recommend very short names to prevent destroying portions
  90.             of the picture with your text.  So, I would keep the program
  91.             in the drive (and directory) in which you wish to save the
  92.             image.  Note that high resolution images require 224000
  93.             bytes and medium resolution images require 64000 bytes.
  94.                  If you have an enhanced graphics adapter, you can use
  95.             the MANDELLO program to generate images more quickly, and
  96.             then use MANDELEX to get more detailed views of the
  97.             interesting pictures.
  98.                  Because the saved files are so long, I have written a
  99.             program which will compress the size of MOST files.  In some
  100.             cases (in which colors are scattered very randomly) the
  101.             program could expand the file size.  To use this program,
  102.             make sure the default drive contains the PICPAC program, and
  103.             one of the drives contains the file you want to compress
  104.             (pack).  Type PICPAC.  You will be prompted for the name of
  105.             the file you want to pack and the name of the file to be
  106.             created--be sure you use a different name.
  107.                  To expand a packed file, follow the procedure outlined
  108.             above, except with the UNPACPIC file in the default drive
  109.             and the file to be unpacked in one of the drives.  Type
  110.             UNPACPIC and respond to the prompts.
  111.                  Saved images can be re-created either from packed files
  112.             or unpacked files.  To generate an image from an unpacked
  113.             file, make sure the saved file is in one of the drives and
  114.             the PLOT file is in the default drive.  Type PLOT and give
  115.             the name of the image file at the prompt.  If the file you
  116.             want to use is packed, put the PLOTPAC file in the default
  117.             drive and type PLOTPAC.  The program will prompt you for the
  118.             file name and the screen resolution.
  119.                  The plotting and packing programs are very flexible.
  120.             They will accept any file (even copies of themselves--see
  121.             "Godel, Escher, Bach" by Douglas Hofstadter)--however, I
  122.             doubt that they are of much use.  Some programs do generate
  123.             interesting patterns if you use the PLOT or PLOTPAC programs
  124.             on them.  If you are going to experiment with these, I would
  125.             recommend using copies of the data or program files that you
  126.             plot, pack, or unpack, rather than the originals.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.                                   TECHNICAL INFORMATION
  206.                                                
  207.                  The expanded files simply consist of a chain of color
  208.             values (one byte corresponding to one pixel) from the lower
  209.             right corner to the upper left corner of the screen.  This
  210.             allows a possibility of 256 colors, although the program
  211.             does not support such devices at this time.  The pack
  212.             program consists of a color value followed by the number of
  213.             pixels of that color (up to 255), in the same order as the
  214.             expanded files.  So, if you want to use these images with
  215.             other programs, it should be very easy to read the data from
  216.             these files and put it to use.  One interesting idea would
  217.             be to change the palette and color assignments, or to change
  218.             the design.  If you come up with any applications for these
  219.             files I would be interested in hearing about them.
  220.                  The program may seem quite, slow.  Be assured that the
  221.             main constraint is the calculation time.  I have optimized
  222.             the 8087 code repeatedly, and it now runs about three times
  223.             faster than the original.  Most of the increase was obtained
  224.             by using the stack for almost all of the 8087 operations
  225.             (rather than reliance on memory).  Points which appear as
  226.             black have gone through the generating formula 1000 times--
  227.             other colors, various fractions of that amount.  Actual
  228.             plotting time could probably be increased slightly, but at a
  229.             loss of compatibility (and a few minutes should not make
  230.             much difference in a program which takes a few hours to
  231.             run).  If anybody runs this program on an AT or another
  232.             machine with a faster clock and/or processor, I would
  233.             appreciate some benchmark information (coordinates used and
  234.             time to completion--as well as the type of graphics adapter
  235.             and mode used).  The program does not run faster on an AT
  236.             with a normal 80287, because the co-processor runs at a
  237.             slower clock rate than the 80286, however there are kits
  238.             available which use a faster 80287, and these are the
  239.             systems I am interested in hearing about.
  240.                  As a rough guide for those who are interested, the 8087
  241.             versions run over 25 times faster than the non-8087
  242.             versions.  The AT runs the non-8087 versions about three
  243.             times faster, and the PC runs the 8087 version just a
  244.             fraction faster than the AT.
  245.                  All of the programming was done in assembly language,
  246.             with the exception of the non-8087 floating point routines
  247.             which were written in compiled BASIC.
  248.                  
  249.                  If you are interested in changing the number of
  250.             iterations, follow the instructions below.  If you want to
  251.             know more about the instructions given below, consult the
  252.             DEBUG section of the DOS manual.
  253.             
  254.                  To change the number of times the loop is used (the
  255.             original value is 1000), follow these steps:
  256.             
  257.             1. Enter the debugger and load the appropriate file e.g.
  258.                DEBUG B:MANDSLO.EXE.
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.             
  272.             2. Run the program to the point where the DS register is set
  273.                (G 9 should do this).
  274.             
  275.                  The addresses in the following instructions will be
  276.             slightly different for the different versions of the
  277.             program.  For consistency, all examples will use
  278.             MANDELLO.EXE, and will change the default value of 1000
  279.             (3E8h) to 500 (1F4h).  Values which may differ will have
  280.             asterisks around them, and a table of the correct values
  281.             appears at the end of the instructions.  Also note that the
  282.             code segment value (the first four digits before the colon)
  283.             will probably be different, but for the following
  284.             instructions it is insignificant unless you use the E
  285.             command in place of the U command.
  286.             
  287.             3. Type d *0080* and look for the line which looks something
  288.                like this:
  289.             3508:*0080*  30 00 43 00 E8 03 00 00-FF FF FF FF C8 00 00 00
  290.             
  291.             4. Change the values E8 and 03 to whatever new value you
  292.                want (E8 03 is 1000, note that the bytes are in reverse
  293.                order--normally this would be written 03E8h).  So in this
  294.                case, if you want 500 you would enter E *84* f4 1 to
  295.                (E)nter at location 84 the values f4 and 1.
  296.             
  297.             5. Type U *3d* and look for the following lines.
  298.                3463:*003D* C7068600E803  MOV     WORD PTR [*0086*],03E8
  299.                3463:*0043* B8E803        MOV     AX,03E8
  300.                The value 03E8 hex needs to be change to the new value.
  301.                This can be accomplished here by entering the following
  302.                lines:
  303.                
  304.                A *003D* <return>
  305.                MOV WORD PTR [*0086*],01F4 <return>
  306.                MOV AX,01F4 <return>
  307.                <return>
  308.                
  309.                Alternately, d CS:*0030* (where CS is the code segment
  310.                value, in this case, 3463.  This value will be different
  311.                depending on the configuration of your computer) can be
  312.                used to find the E8 03, and F4 01 can be entered by the
  313.                method in the preceeding step.
  314.                
  315.             6. Type U *0076* and find the following line.
  316.                3463:*0076* C7068600E803  MOV     WORD PTR [*0086*],03E8
  317.                Change the 03E8 to 01F4 as described above.
  318.             
  319.             7. Type U *0114* and find the following line.
  320.                3463:*0114* B9E803        MOV     CX,03E8
  321.                Change it as described above.  If you did everything
  322.                correctly, you are now ready to run the modified program.
  323.                
  324.             8. Type G, and the program will run.
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.             
  338.             
  339.             MANDSLEX
  340.             352C:0080  58 00 43 00 E8 03 00 00-FF FF FF FF 5E 01 00 00
  341.             357F:003D C7068600E803  MOV     WORD PTR [0086],03E8
  342.             357F:0043 B8E803        MOV     AX,03E8
  343.             357F:00FF B9E803        MOV     CX,03E8
  344.             
  345.             
  346.             MANDELEX
  347.             3580:0042 C7067200E803  MOV     WORD PTR [0072],03E8
  348.             3580:0048 B8E803        MOV     AX,03E8
  349.             3580:0101 B9E803        MOV     CX,03E8
  350.             
  351.             
  352.             MANDELLO
  353.             357E:0042 C7067200E803  MOV     WORD PTR [0072],03E8
  354.             357E:0048 B8E803        MOV     AX,03E8
  355.             357E:007B C7067200E803  MOV     WORD PTR [0072],03E8
  356.             357E:0116 B9E803        MOV     CX,03E8
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.